<script setup lang="ts">
import { regularPhone } from '@/utils/regular'
import { reactive } from 'vue'
const phone = reactive({
  phoneNumber: '',
  password: ''
})

const rulesPhone = reactive({
  phoneNumber: [
    { required: true, message: 'Please input phone number', trigger: 'blur' },
    {
      pattern: regularPhone,
      message: '请输入正确的手机号',
      trigger: 'blur'
    }
  ],
  password: [
    { required: true, message: 'Please input password', trigger: 'blur' }
  ]
})
</script>

<template>
  <div class="phone">
    <el-tab-pane label="Phone" name="phone">
      <template #label>
        <span class="icon">
          <el-icon><Iphone /></el-icon>
        </span>
        Phone
      </template>
      <div class="phone">
        <el-form
          label-position="left"
          :model="phone"
          label-width="80px"
          size="large"
          :rules="rulesPhone"
        >
          <el-form-item label="phone" prop="phoneNumber">
            <el-input v-model="phone.phoneNumber" />
          </el-form-item>
          <el-form-item label="password" prop="password">
            <el-input v-model="phone.password" type="password" show-password />
          </el-form-item>
        </el-form>
      </div>
    </el-tab-pane>
  </div>
</template>

<style scoped></style>
